﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReceiptInvPallet.aspx.cs" EnableEventValidation="false" Inherits="WMS6.Web.Inbound.ReceiptInvPallet" meta:resourcekey="PageResource1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>InvPallet</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>
    <script src="../Js/util.js" id="js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>    
    <script src="../Js/checkbox.js" type="text/javascript"></script>  
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            var lang = getRequest('lang');
            var style = getRequest('style');
            initQueryPage(lang,style);
        }
        
        //当货品代码文本框失去焦点的时候 给隐藏的RowIndex赋值
        function setSkuIDRowIndex(rowIndex)
        {
            document.getElementById("hdnRowIndex").value = rowIndex;
        }
        function setExecDateRowIndex(rowIndex)
        {
            document.getElementById("hdnExecDateRowIndex").value = rowIndex;
        }
        
        //验证用户输入的PageIndex
        //只允许输入数字，并且第一个字符不能为0
        function checkInputPageIndex(obj)
        {
            if(obj!=null)
            {
                var inputIndex = obj.value;
                inputIndex = inputIndex.replace(/[^\d]/g,'');
                if(inputIndex.length == 1 && inputIndex == "0")
                {
                    obj.value = "";
                }
                else
                {
                    obj.value = inputIndex;
                }
            }
        }
        function insertNewRow()
        {   
            if(event.keyCode == 45)
            {
                document.getElementById("btnAddDetail").click();
            }
            else if(event.keyCode == 13)
            {
                event.keyCode = '9';
            }
        }
    </script>

</head>
<body onkeydown="insertNewRow()">
    <form runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblReceiptInvPallet" runat="server" CssClass="label_header" Text="入库箱托"
                            meta:resourcekey="lblReceiptInvPalletResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnAddDetail %>"
                            OnClick="btnAddDetail_Click" meta:resourcekey="btnAddDetailResource1" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnSave %>"
                            OnClick="btnSave_Click" meta:resourcekey="btnSaveResource1" />
                    </td>
                    <td>
                        <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnDeleteDetail %>"
                            OnClick="btnDeleteDetail_Click" meta:resourcekey="btnDeleteDetailResource1" />
                    </td>
                    <td>
                        <asp:FileUpload ID="fileupPallet" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="btnImport" runat="server" Text="导入" CssClass="button" OnClick="btnImport_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$Resources:ButtonResource,btnExport%>"
                            CssClass="button" OnClick="btnExport_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnAudit" runat="server" Text="审核" CssClass="button" OnClick="btnAudit_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnRevertAudit" runat="server" Text="反审核" CssClass="button" OnClick="btnRevertAudit_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsgResource1"></asp:Label>
        </div>
        <div id="div_content1" style="margin-top: 10px;">
            <%--<asp:UpdatePanel ID="up1" runat="server">
                <ContentTemplate>--%>
                    <div id="con_one_1" style="display: block; overflow-x: auto; overflow-y: hidden;">
                        <table style="display: block; margin-left: 10px; margin-top: 10px; width: 708px;
                            height: 346px;">
                            <tr>
                                <td>
                                    <div style="margin-top: 10px; height: 323px; width: 707px;">
                                        <asp:GridView ID="gvInvPallet" runat="server" AutoGenerateColumns="False" CssClass="gridview"
                                            DataKeyNames="LineID" Width="600px" OnRowDataBound="gvInvPallet_RowDataBound"
                                            meta:resourcekey="gvInvPalletResource1">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <PagerStyle CssClass="GridViewPageStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:TemplateField meta:resourcekey="TemplateField">
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvInvPallet');"
                                                            meta:resourcekey="CheckBox1" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chbSelect" runat="server" TabIndex="-1" meta:resourcekey="chbSelect" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvInvPallet');"
                                                            meta:resourcekey="CheckBox2" />
                                                    </FooterTemplate>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40" />
                                                </asp:TemplateField>
                                                <asp:BoundField HeaderText="行号" FooterText="行号" meta:resourcekey="BoundFieldResource1">
                                                    <ItemStyle CssClass="GridViewRowWidth_50" />
                                                </asp:BoundField>
                                                <asp:TemplateField FooterText="货品代码" HeaderText="货品代码" SortExpression="SkuID" meta:resourcekey="TemplateFieldResource1">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtSkuID" runat="server" Text='<%# Eval("SkuID").ToString() %>'
                                                            Width="100px" AutoPostBack="True" MaxLength="50" OnTextChanged="txtSkuID_TextChanged"
                                                            meta:resourcekey="txtSkuIDResource1"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="收货托数" HeaderText="收货托数" SortExpression="PALLET" meta:resourcekey="TemplateFieldResource2">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtPallet" runat="server" Text='<%# GetPreferenceDigit(Eval("PALLET").ToString()) %>'
                                                            onkeyup="checkInputPageIndex(this)" AutoPostBack="True" MaxLength="9" Width="100px"
                                                            meta:resourcekey="txtPalletResource1"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="收货箱数" HeaderText="收货箱数" SortExpression="CASE" meta:resourcekey="TemplateFieldResource3">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtCase" runat="server" Text='<%# GetPreferenceDigit(Eval("CASE").ToString()) %>'
                                                            onkeyup="checkInputPageIndex(this)" Width="100px" AutoPostBack="True" MaxLength="9"
                                                            meta:resourcekey="txtCaseResource1"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="入库日期" HeaderText="入库日期" SortExpression="ExecDate"
                                                    meta:resourcekey="TemplateFieldResource4">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtExecDate" Width="100px" runat="server" Text='<%# Eval("ExecDate").ToString() %>'
                                                            AutoPostBack="True" OnTextChanged="txtExecDate_TextChanged" meta:resourcekey="txtExecDateResource1"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="备注" HeaderText="备注" SortExpression="Remark" meta:resourcekey="TemplateFieldResource5">
                                                    <ItemTemplate>
                                                        <asp:TextBox ID="txtRemark" Width="100px" runat="server" Text='<%# Eval("Remark").ToString() %>'
                                                            meta:resourcekey="txtRemarkResource1"></asp:TextBox>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblRed" runat="server" CssClass="label" BackColor="Red" Style="width: 15px;
                                        height: 15px;" meta:resourcekey="lblRedResource1">&nbsp;&nbsp;&nbsp;</asp:Label>
                                    <asp:Label ID="lblRedText" runat="server" CssClass="label" Text="货品不存在" meta:resourcekey="lblRedTextResource1"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblInsert" runat="server" CssClass="label" Text="注：按Insert键可新增一行明细"
                                        meta:resourcekey="lblInsertResource1"></asp:Label>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                <%--</ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnAddDetail" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnDeleteDetail" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnImport" EventName="Click" />
                    <%--<asp:AsyncPostBackTrigger ControlID="btnExport" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>--%>
        </div>
    </div>
    <input type="hidden" id="hiddenFlag" />
    <input type="hidden" id="hdnRowIndex" runat="server" />
    <input type="hidden" id="hdnExecDateRowIndex" runat="server" />
    <input type="hidden" id="hdncalendarFlag" runat="server" />
    <input type="hidden" id="hdnOwnerID" runat="server" />
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnOrderID" runat="server" />
    </form>
</body>
</html>
